<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang=ko>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>session2.jsp</title>
	<link rel='stylesheet' type='text/css' href='./css/main.css'>
	<script src='./js/session2.js'></script>
</head>
<body>
<%
	String d = (String)session.getAttribute("data2");
	if(d==null)
	{
%>
		<%--세션에 데이터를 저장하기 전 폼--%>
		<div class=title>Session Test2</div>
		<form id='session2_form' method='post'>
			<label>Data : </label>
			<input type='search' name='data2' id='data2'>
			<br>
			<input type=button id='okBtn' value='Ok'>
		</form>
		
		<script>InitBefore();</script>
<%
	}
	else
	{
%>
		<%--세션에 데이터가 저장된 후 폼--%>
		<div class=title>Session Test2</div>
		<form id='session2_form' method='post'>
			<label>저장된 데이터 : </label>
			<input type='search' name='data2' id='data2' value='<%=d%>'>
			<input type=button id='endBtn' value='End'>
		</form>
		
		<script> InitAfter();</script>
<%
	}
%>

</body>
</html>